package micropascalcomp.FSA;

import java.io.*;
import micropascalcomp.MP_Token;
import micropascalcomp.Token;

/**
 * The FSA wrapper class for the method that handles finding the period token
 * @author Jason Welch, Codi Gann, Jamal Martin
 */
public class PeriodFSA implements FSABehavior{
    
    public MP_Token getToken(FileReader file, LineNumberReader inFile, int colNum){
        MP_Token result = null;     //token class to be returned
        int readChar;
        String lexeme = "";         //var to hold the lexeme string
        
        try {
            readChar = inFile.read();       //grab the first char for the tolken
            lexeme = "" + (char)readChar;   //add it to the lexeme string
            //create token class
            result = new MP_Token(Token.MP_PERDIOD, lexeme, inFile.getLineNumber(), colNum);
        } catch (IOException e) {
            System.err.println(e);
        }
        
        return result;
    }
}
